package org.dromara.patrol.domain.vo;

import java.math.BigDecimal;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import org.dromara.patrol.domain.PatrolTemplate;

import java.io.Serial;
import java.io.Serializable;



/**
 * 巡店管理-巡店模板配置视图对象 patrol_template
 *
 * @author LionLi
 * @date 2024-03-25
 */
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = PatrolTemplate.class)
public class PatrolTemplateVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 巡店模板id
     */
    @ExcelProperty(value = "巡店模板id")
    private Long templateId;

    /**
     * 巡店模板名称
     */
    @ExcelProperty(value = "巡店模板名称")
    private String name;

    /**
     * 描述
     */
    @ExcelProperty(value = "描述")
    private String description;

    /**
     * 分类等级（0 - 4 五个等级，用户自建默认 3）
     */
    @ExcelProperty(value = "分类等级", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "0=,-=,4=,五=个等级，用户自建默认,3=")
    private Long level;

    /**
     * 模板分数
     */
    @ExcelProperty(value = "模板分数")
    private BigDecimal aggregateScore;

    /**
     * 模式（字典表：DEDUCTION 扣分模式，SCORE 评分模式）
     */
    @ExcelProperty(value = "模式", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "字=典表：DEDUCTION,扣=分模式，SCORE,评=分模式")
    private String markStrategy;

    /**
     * 整改触发阈值
     */
    @ExcelProperty(value = "整改触发阈值")
    private BigDecimal rectifyThreshold;

    /**
     * 评分项数量
     */
    @ExcelProperty(value = "评分项数量")
    private Long itemNum;

    /**
     * 打分习惯（如果是评分模式，需要设置： DEDUCT 扣分， SCORE 得分）
     */
    @ExcelProperty(value = "打分习惯", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "如=果是评分模式，需要设置：,D=EDUCT,扣=分，,S=CORE,得=分")
    private String scoreHabit;

    /**
     * 版本
     */
    @ExcelProperty(value = "版本")
    private String ver;

    /**
     * 得分计算公式，格式用","分割，包含数字、运算符、常量等（常量定义："TOTAL_SCORE" 模板总分，"TOTAL_GET_SCORE" 评分项总得分，"TOTAL_DEDUCTION_SCORE" 评分项总扣分，"ITEM_COUNT" 总评分项数，"INAPPLICABLE_ITEM_SCORE" 不适用评分项分数，"RESPONSIBLE_PERSONS" 责任人个数，"RP_SCORE" 责任人关联评分项总得分，"RP_DEDUCTION_SCORE" 责任人关联评分项总扣分）
     */
//    @ExcelProperty(value = "得分计算公式，格式用","分割，包含数字、运算符、常量等", converter = ExcelDictConvert.class)
//    @ExcelDictFormat(readConverterExp = "常=量定义："TOTAL_SCORE",模=板总分，"TOTAL_GET_SCORE",评=分项总得分，"TOTAL_DEDUCTION_SCORE",评=分项总扣分，"ITEM_COUNT",总=评分项数，"INAPPLICABLE_ITEM_SCORE",不=适用评分项分数，"RESPONSIBLE_PERSONS",责=任人个数，"RP_SCORE",责=任人关联评分项总得分，"RP_DEDUCTION_SCORE",责=任人关联评分项总扣分")
    private Object calculateRule;

    /**
     * 是否启用（0正常 1停用）
     */
    @ExcelProperty(value = "是否启用", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "0=正常,1=停用")
    private String status;

    /**
     * 全部不得分（字典表：0 是， 1 否；如果分类配置表nodeScoreType 全部都是NO_SCORING 则为 1）
     */
    @ExcelProperty(value = "全部不得分", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "字=典表：0,是=，,1=,否=；如果分类配置表nodeScoreType,全=部都是NO_SCORING,则=为,1=")
    private String allNoScoring;


    /**
     * 模版总分
     */
    private BigDecimal scoreCount;


}
